import React from 'react'
import store from '../redux/store'
import useRedux from '../react-redux' //react-redux这个js文件,是我们自己定义的
export default function Count() {
  useRedux()
  return (
    <div>
      <h1>Count</h1>
      <hr />
      <p>{store.getState().count}</p>
      <button
        onClick={() => {
          store.dispatch({ type: 'add' })
        }}
      >
        +
      </button>
    </div>
  )
}
